<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>提示页面</title>
    <link href="<?=base_url()?>/assets/layui/css/layui.css" rel="stylesheet">
    <style>
        body {
            /* background-color: #ededed; */
            background-color: #fff;
        }

        .wrap {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            box-sizing: border-box;
            opacity: 1;
            z-index: 1;
        }

        .wrap .main {
            max-width: 500px;
            margin: 0px auto;
            padding: 0 16px;
            padding-top: 48px;
            text-align: center;
            line-height: 1.4;
            min-height: 100%;
            box-sizing: border-box;
            display: flex;
            -webkit-box-orient: vertical;
            -webkit-box-direction: normal;
            -webkit-flex-direction: column;
            flex-direction: column;
            background-color: #fff;

        }

        .msg-icon {
            margin-bottom: 32px;
        }

        .msg-icon i {
            width: 64px;
            height: 64px;
            display: inline-block;
            vertical-align: middle;
            mask-repeat: no-repeat;
            font-size: 50px;
        }

        .msg-icon i.icon-success {
            color: #07c160;
        }

        .msg-icon i.icon-error {
            color: #fa5151;
        }

        .msg-icon i.icon-default {
            color: #576b95;
        }

        .msg-text {
            font-size: 17px;
            margin-bottom: 32px;
            padding: 0 32px;
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
            line-height: 1.6;
        }

        .msg-text-title {
            margin-bottom: 16px;
            font-weight: 700;
            font-size: 22px;
            color: rgba(0, 0, 0, 0.9);
            word-wrap: break-word;
            word-break: break-all;
        }

        .msg-text-desc a {
            color: #576b95;
            display: inline-block;
            vertical-align: baseline
        }

        .msg-option {
            margin-bottom: 16px;
        }

        .msg-btn {
            position: relative;
            display: block;
            width: 184px;
            margin-left: auto;
            margin-right: auto;
            padding: 8px 24px;
            box-sizing: border-box;
            font-weight: 700;
            font-size: 17px;
            text-align: center;
            text-decoration: none;
            color: #fff;
            line-height: 1.41176471;
            border-radius: 4px;
            overflow: hidden;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        }

        .msg-footer {
            margin-bottom: 24px;
            color: rgba(0, 0, 0, 0.5);
            font-size: 14px;
            line-height: 1.4;
            text-align: center;
        }

        .footer-link a {
            margin: 0 8px;
            position: relative;
            font-size: 14px;
            display: inline-block;
            vertical-align: baseline;
        }

        .footer-text {
            padding: 0 16px;
            font-size: 12px;
        }

    </style>
</head>

<body>

    <div class="wrap wrap-msg">

        <div class="main">

            <div class="msg-icon">
                <?php if($code=='0'):?>
                <i class="icon icon-success layui-icon layui-icon-face-smile"></i>
                <?php elseif($code>=1):?>
                <i class="icon icon-error layui-icon layui-icon-face-cry"></i>
                <?php else:?>
                <i class="icon icon-default layui-icon layui-icon-tips"></i>
                <?php endif?>
            </div>

            <div class="msg-text">
                <h2 class="msg-text-title"><?=$msg ?? '提示'?></h2>
                <div class="msg-text-desc">
                    <p><a href="<?=$url ?? '/'?>" id="tourl">如果没有自动跳转,可以点击这里 （<span id="second" data-time="<?=$time ? $time : 0?>"><?=$time ? $time : 0?></span>）</a></p>
                </div>
            </div>

            <div class="msg-option">
                <p class="msg-btn-area">
                    <a href="/" class="layui-btn layui-btn-normal">[返回首页]</a>
                    <a href="javascript:history.back(); <?=$url ?? '/'?>" class="msg-btn msg-btn-primary">确定</a>
                </p>
            </div>

            <div class="msg-footer">
                <div class="weui-footer">
                    <p class="footer-link">
                        <a class=""></a>
                    </p>
                    <p class="footer-text"></p>
                </div>
            </div>

        </div>

    </div>
    <script src="<?=base_url()?>/assets/layui/layui.js"></script>
    <script type="text/javascript">
        var time = document.getElementById("second").text;
        var tourl = document.getElementById("tourl").href;

        layui.use(['jquery', 'layer'], function () {
            var $ = layui.jquery, layer = layui.layer;
            function cdown(e) {
                var t = parseInt($("#second").text());
                var tourl = $("#tourl").attr('href');
                var interv = setInterval(function () {
                    if (0 == t) {
                        clearInterval(interv);
                        if (tourl && tourl != 'undefined') {
                            if (window.frames.length != parent.frames.length) {
                                //在iframe中
                            }
                            location.href = tourl;
                        }
                    } else {
                        t -= 1;
                        $("#second").text(t);
                    }
                }, 970);
            }
            cdown();
        });
    </script>

</body>

</html>
